import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { Bbb2Service } from './bbb2.service';
import { CreateBbb2Dto } from './dto/create-bbb2.dto';
import { UpdateBbb2Dto } from './dto/update-bbb2.dto';
import { RequirePermission } from '../RequirePermissionDecorator';
import { RequireLogin } from '../RequireLoginDecorator';

@Controller('bbb2')
export class Bbb2Controller {
  constructor(private readonly bbb2Service: Bbb2Service) {}

  @Post()
  create(@Body() createBbb2Dto: CreateBbb2Dto) {
    return this.bbb2Service.create(createBbb2Dto);
  }

  @Get()
  @RequireLogin()
  @RequirePermission('查询 bbb')
  findAll() {
    return this.bbb2Service.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.bbb2Service.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateBbb2Dto: UpdateBbb2Dto) {
    return this.bbb2Service.update(+id, updateBbb2Dto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.bbb2Service.remove(+id);
  }
}
